#!/bin/bash

export STARDB_MODULE=api-demo
echo "begin to start generate JDCloud openAPI"

dir=$(pwd)
echo "generate path = $dir"
cd "$dir" || exit

if [ ! -f "openapi-codegen-1.0-jar-with-dependencies.jar" ]; then
  echo "build.sh no available profile. dev or test"
  exit 1
fi

java -jar openapi-codegen-1.0-jar-with-dependencies.jar -i "$dir/$STARDB_MODULE" -o "$dir/$STARDB_MODULE" -l "java" -a

echo "success generate JDCloud openAPI"
